let app = getApp();
Page({
  data: {
    clientId: '',
    userInfo:null
  },
  onLoad(options){
    let that = this;
    app.get('YeWuYuankeHu', {
      action: 'getkehubyid',
      id: options.id
    }).then((res)=>{     
      that.setData({
        clientId: options.id,
        userInfo: res
      });
    })
  },
  submitForm(res){
    app.get('YeWuYuankeHu',{
      action:'xiugaikehuxinxi',
      id: this.data.clientId,
      XingMing: res.detail.value.name,
      GongSi: res.detail.value.compary,
      LianXiDiZhi: res.detail.value.address,
      BeiZhu: res.detail.value.comment
    }).then((e)=>{
      if (e.msg ==='修改成功！'){        
        wx.reLaunch({
          url: '/pages/client/client',
        });
        app.toast(e.msg);
      }else{
        app.toast(e.msg);
      }      
    })
  },
  resetForm() {

   },
  loadInfo(){
      
    
  },
  previewImage(e) {
    var current = e.target.dataset.src
    wx.previewImage({
      current: current,
      urls: this.data.imageList
    })
  }
})
